<?php

namespace app\admin\validate;

use think\Validate;

class Friednlink extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
	protected $rule = [
        'title' => ['require', 'length' => '2, 255'],
        'homepage' => ['require']
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message = [
        'titel.require' => '标题必填',
        'titel.homepage' => '链接地址必填'
    ];
    // 验证场景定义
    protected $scene = [
        'friendlink' => ['title', 'homepage']
    ];
}
